runOnStartup(async runtime => {
    runtime.addEventListener("tick", () => tick())
    runtime.getLayout("MainLevel").addEventListener("afterlayoutstart", () => init())
});
function tick() {
    if (runtime.layout.name != "MainLevel") return;
    gemAteByPlayer.playerAteGem()
}
function init() {
}
globalThis.gemAteByPlayer={
    playerAteGem:function(){
        /**@type {ISpriteInstance} */
        let PlayerCollision =runtime.objects.PlayerCollision.getFirstInstance()
        for(let thisGem of runtime.objects.Gem.instances())
        {
            if(PlayerCollision.testOverlap(thisGem)){
                /**@type {ISpriteInstance} */
                let getGem =thisGem
                /** @type {I3DShapeInstance} */
                let newDEsEffect = runtime.objects.Flash.createInstance("flash",getGem.x,getGem.y,true)
                newDEsEffect.zHeight*=1.5
                newDEsEffect.height*=1.5
                newDEsEffect.width*=1.5
                getGem.destroy()
                playerSelfdata.Score+=500
            }
        }
    }
}
export default gemAteByPlayer